package com.hongxun.design.bean;

import com.hongxun.design.bean.photopassbean.PhotoPassIconBean;
import com.hongxun.design.mytools.MString;

import java.util.ArrayList;
import java.util.List;

/**
 * Created by zerdoor_pc on 2016/5/16.
 * 通道拍照详情
 */
public class PhotoPassagewayItemBean {

    private String url="";
    private String urlSeleck="";
    private String name="";
    private String value="";
    private int[] xy;
    private List<PhotoPassIconBean> dialogBean;
    public String pt_id="";//点类型
    public String number="";//点类型
    private String channel_id="";//点类型
    private String uuid="";
    public String pt_objectid="";//点对象
    public String distance="";//距离
    public String exploration_id="";//当前踏勘点id
    public String exploration_uuid="";//当前踏勘点uuid
    public String feature_id="";//新增踏勘点uuid
    public String feature_uuid="";//新增踏勘点id
    public ChannelListBean channelListBean;//
    public ChannelAListBean channelAListBean;//

    public PhotoPassagewayItemBean() {
    }

    public PhotoPassagewayItemBean(String pt_id, String url, String urlSeleck, String name, String value, List<PhotoPassIconBean> dialogBean) {
        this.url = MString.LOCALIMAGEHEAD + url;
        this.urlSeleck = MString.LOCALIMAGEHEAD + urlSeleck;
        this.pt_id = pt_id;
        this.name = name;
        this.value = value;
        this.dialogBean = dialogBean;

    }

    public PhotoPassagewayItemBean(String pt_id, ChannelListBean channelListBean, String url, String urlSeleck, String name, String value, List<PhotoPassIconBean> dialogBean) {
        this.url = MString.LOCALIMAGEHEAD + url;
        this.urlSeleck = MString.LOCALIMAGEHEAD + urlSeleck;
        this.pt_id = pt_id;
        this.channelListBean = channelListBean;
        this.name = name;
        this.value = value;
        this.dialogBean = dialogBean;
        if (channelListBean != null) {
            distance = channelListBean.distance;
            exploration_id = channelListBean.exploration_id;

            pt_objectid = channelListBean.pt_objectid;
            this.value = channelListBean.number;
        }
    }

    public PhotoPassagewayItemBean(String pt_id, Exploration e, String url, String urlSeleck, String name, String value, List<PhotoPassIconBean> dialogBean) {
        this.url = MString.LOCALIMAGEHEAD + url;
        this.urlSeleck = MString.LOCALIMAGEHEAD + urlSeleck;
        this.pt_id = pt_id;
        this.name = name;
        this.dialogBean = dialogBean;
        if (e != null) {
            distance = e.getDistance();
            exploration_id = MString.getValueId(e.getExploration_id(),e.getUuid());
            pt_objectid = e.getPt_objectid();
            this.value = e.getNumber();
        }
    }

    public PhotoPassagewayItemBean(String pt_id, ChannelAListBean channelAListBean, String url, String urlSeleck, String name, String value, List<PhotoPassIconBean> dialogBean) {
        this.url = MString.LOCALIMAGEHEAD + url;
        this.urlSeleck = MString.LOCALIMAGEHEAD + urlSeleck;
        this.pt_id = pt_id;
        this.channelAListBean = channelAListBean;
        this.name = name;
        this.value = value;
        this.dialogBean = dialogBean;
        if (channelAListBean != null) {
            channel_id = channelAListBean.channel_id;
            uuid = channelAListBean.uuid;
            distance = channelAListBean.distance;
            exploration_id = channelAListBean.exploration_id;
            pt_objectid = channelAListBean.pt_objectid;
            number = channelAListBean.number;
        }
    }

    public void setBean(PhotoPassagewayItemBean bean) {
        url = bean.getUrl() + "";
        urlSeleck = bean.getUrlSeleck() + "";
        name = bean.getName() + "";
        value = bean.getValue() + "";
        xy = new int[]{bean.getXy()[0], bean.getXy()[1]};
        pt_id = bean.getPt_id() + "";//点类型
        channel_id = bean.getChannel_id() + "";//点类型
        uuid = bean.getUUID() + "";//点类型
        pt_objectid = bean.getPt_objectid() + "";//点对象
        distance = bean.getDistance() + "";//距离
        exploration_id = bean.getExploration_id() + "";//踏勘点id
        exploration_uuid = bean.getExploration_uuid() + "";//踏勘点id
        dialogBean = new ArrayList<>();
        for (PhotoPassIconBean b : bean.getDialogBean()) {
            PhotoPassIconBean mb=new PhotoPassIconBean();
            mb.setBean(b);
            dialogBean.add(mb);
        }


    }


    public String getFeature_id() {
        return feature_id;
    }

    public void setFeature_id(String feature_id) {
        this.feature_id = feature_id;
    }

    public String getFeature_uuid() {
        return feature_uuid;
    }

    public void setFeature_uuid(String feature_uuid) {
        this.feature_uuid = feature_uuid;
    }



    public String getExploration_uuid() {
        return exploration_uuid;
    }

    public void setExploration_uuid(String exploration_uuid) {
        this.exploration_uuid = exploration_uuid;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public String getUrlSeleck() {
        return urlSeleck;
    }

    public void setUrlSeleck(String urlSeleck) {
        this.urlSeleck = urlSeleck;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getValue() {
        return value;
    }

    public void setValue(String value) {
        this.value = value;
    }

    public int[] getXy() {
        return xy;
    }

    public void setXy(int[] xy) {
        this.xy = xy;
    }

    public List<PhotoPassIconBean> getDialogBean() {
        return dialogBean;
    }

    public void setDialogBean(List<PhotoPassIconBean> dialogBean) {
        this.dialogBean = dialogBean;
    }


    public String getPt_id() {
        return pt_id;
    }

    public void setPt_id(String pt_id) {
        this.pt_id = pt_id;
    }

    public String getPt_objectid() {
        return pt_objectid;
    }

    public void setPt_objectid(String pt_objectid) {
        this.pt_objectid = pt_objectid;
    }

    public String getDistance() {
        return distance;
    }

    public void setDistance(String distance) {
        this.distance = distance;
    }

    public String getExploration_id() {
        return exploration_id;
    }

    public void setExploration_id(String exploration_id) {
        this.exploration_id = exploration_id;
    }

    public ChannelListBean getChannelListBean() {
        return channelListBean;
    }

    public void setChannelListBean(ChannelListBean channelListBean) {
        this.channelListBean = channelListBean;
    }

    public String getChannel_id() {
        return channel_id;
    }

    public void setChannel_id(String channel_id) {
        this.channel_id = channel_id;
    }

    public ChannelAListBean getChannelAListBean() {
        return channelAListBean;
    }

    public void setChannelAListBean(ChannelAListBean channelAListBean) {
        this.channelAListBean = channelAListBean;
    }

    public String getUUID() {
        return uuid;
    }

    public void setUUID(String uuid) {
        this.uuid = uuid;
    }

    public String getNumber() {
        return number;
    }

    public void setNumber(String number) {
        this.number = number;
        if (channelAListBean != null) {
             channelAListBean.number=number;
        }
    }
}
